package tq.com.tqteacher.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

import com.githang.statusbar.StatusBarCompat;

import tq.com.tqcom.base.BaseActivity;
import tq.com.tqcom.base.BaseFragment;
import tq.com.tqcom.base.BaseTitleActivity;
import tq.com.tqcom.util.TQSystemDefine;
import tq.com.tqteacher.R;
import tq.com.tqteacher.fragment.TQDirectoryFragment;
import tq.com.tqteacher.view.TQHeader3ViewHold;

public class TQDirectoryActivity extends BaseTitleActivity {
    private TQDirectoryFragment mDirectoryFragment = null;

    static public String RESULT_KEY = "RESULT_KEY";

    static public String REQUEST_SELECT_KEY = "REQUEST_SELECT_KEY";
    static public String REQUEST_LOAD_FILE_KEY = "REQUEST_LOAD_FILE_KEY";

    public static void showSelect(Activity pActivity, int requestCode, int loadType){
        Intent intent = new Intent(pActivity, TQDirectoryActivity.class);
        intent.putExtra(REQUEST_SELECT_KEY, 0x01);
        intent.putExtra(REQUEST_LOAD_FILE_KEY, loadType);
        pActivity.startActivityForResult(intent, requestCode);
    }
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_fragement0_layout);

        StatusBarCompat.setLightStatusBar(getWindow(), true);

        int loadType = getIntent().getIntExtra(REQUEST_LOAD_FILE_KEY, TQSystemDefine.FILE_TYPE_ALL);
        if(mDirectoryFragment == null){
            mDirectoryFragment = TQDirectoryFragment.showWithType(1, loadType);
        }

        getSupportFragmentManager().beginTransaction().replace(R.id.content, mDirectoryFragment).commit();

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
